//
//  BK_OD_TimeList.m
//  bestkeep
//
//  Created by TOPTEAM on 2017/3/10.
//  Copyright © 2017年 utouu. All rights reserved.
//

#import "BK_OD_TimeList.h"



@implementation BK_OD_TimeList


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self){
        [self initView];
    }
    return self;
}

- (void)initView{
    self.backgroundColor =  [UIColor whiteColor];
    
    /**
     *  订单号
     */
    _lab_order = [UILabel new];
    _lab_order.textColor = RGB(160, 160, 160);;
    _lab_order.numberOfLines = 2;
    _lab_order.backgroundColor = [UIColor clearColor];
    _lab_order.font = [UIFont systemFontOfSize:FONT_ORDER_Detail_ZHUTI];
    _lab_order.text = @"订 单 号： ";
    [self addSubview:_lab_order];
    [_lab_order mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).mas_offset(ApplicationBackGauge);
        make.top.equalTo(self.mas_top).mas_offset(10);
    }];
    
    _lab_DingDanHao = [BKOrderLabel new];
    _lab_DingDanHao.textColor = RGB(160, 160, 160);
    _lab_DingDanHao.numberOfLines = 2;
    _lab_DingDanHao.backgroundColor = [UIColor clearColor];
    _lab_DingDanHao.font = [UIFont systemFontOfSize:FONT_ORDER_Detail_ZHUTI];
    _lab_DingDanHao.text = @"加载中...";
    [self addSubview:_lab_DingDanHao];
    [_lab_DingDanHao mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_lab_order.mas_right).mas_offset(10);
        make.top.equalTo(_lab_order.mas_top).mas_offset(0);
    }];
    
    
    
    /**
     *  lab_time_submit;//下单时间
     */
    _lab_timeSubmit= [[UILabel alloc]initWithFrame:CGRectZero];
    _lab_timeSubmit.textColor = RGB(160, 160, 160);
    _lab_timeSubmit.text = @"下单时间：";
    _lab_timeSubmit.font = [UIFont systemFontOfSize:FONT_ORDER_Detail_ZHUTI];
    [self addSubview:_lab_timeSubmit];
    [_lab_timeSubmit mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_lab_order.mas_left).mas_offset(0);
        make.top.equalTo(_lab_DingDanHao.mas_bottom).mas_offset(2);
    }];
    
    _lab_time_submit = [UILabel new];
    _lab_time_submit.textColor = RGB(160, 160, 160);;
    _lab_time_submit.numberOfLines = 1;
    _lab_time_submit.backgroundColor = [UIColor clearColor];
    _lab_time_submit.font = [UIFont systemFontOfSize:FONT_ORDER_Detail_ZHUTI];
    _lab_time_submit.text = @"加载中...";
    [self addSubview:_lab_time_submit];
    [_lab_time_submit mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_lab_DingDanHao.mas_left).mas_offset(0);
        make.top.equalTo(_lab_timeSubmit.mas_top).mas_offset(0);
        make.centerY.equalTo(_lab_timeSubmit.mas_centerY);
    }];
    
    
    
    /**
     *  lab_time_pay;//支付时间
     */
    _lab_timePay= [[UILabel alloc]initWithFrame:CGRectZero];
    _lab_timePay.textColor = RGB(160, 160, 160);
    _lab_timePay.text = @"支付时间：";
    _lab_timePay.font = [UIFont systemFontOfSize:FONT_ORDER_Detail_ZHUTI];
    [self addSubview:_lab_timePay];
    [_lab_timePay mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_lab_timeSubmit.mas_left).mas_offset(0);
        make.top.equalTo(_lab_timeSubmit.mas_bottom).mas_offset(2);
    }];
    
    
    _lab_time_pay = [UILabel new];
    _lab_time_pay.textColor = RGB(160, 160, 160);
    _lab_time_pay.numberOfLines = 1;
    _lab_time_pay.backgroundColor = [UIColor clearColor];
    _lab_time_pay.font = [UIFont systemFontOfSize:FONT_ORDER_Detail_ZHUTI];
    _lab_time_pay.text = @"加载中...";
    [self addSubview:_lab_time_pay];
    [_lab_time_pay mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_lab_DingDanHao.mas_left).mas_offset(0);
        make.top.equalTo(_lab_timePay.mas_top).mas_offset(0);
        make.centerY.equalTo(_lab_timePay.mas_centerY);
    }];
    
    
}
-(void)fillData:(id)data{
    BK_My_DetailOrder_CellModel *cellModel = data;
    BK_My_DetailOrder_Model *_centerModel = cellModel.OrderModel;
    if (_centerModel.order_no) {
        _lab_DingDanHao.text=_centerModel.order_no;
    }
    if (_centerModel.order_create_time) {
        _lab_time_submit.text=_centerModel.order_create_time;//下单时间
    }
    
    if (_centerModel.order_pay_time) {
        //有
        _lab_time_pay.text=_centerModel.order_pay_time;
    }else{
        //没有
        _lab_time_pay.hidden=YES;
        _lab_timePay.hidden=YES;
    }
    
}

@end

